﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrainBankCardChecker
{
    internal interface IBankCardChecker
    {
        /// <summary>
        /// 校验银行卡信息（两要素校验）
        /// </summary>
        /// <param name="accountNo">银行卡号</param>
        /// <param name="accountName">户名、姓名</param>
        /// <returns></returns>
        BankCardCheckResult Check(string accountNo, string accountName);

        /// <summary>
        /// 校验银行卡信息（三要素校验）
        /// </summary>
        /// <param name="accountNo">银行卡号</param>
        /// <param name="accountName">户名、姓名</param>
        /// <param name="idCardNo">证件号（证件号，证件类型为空时为身份证号）</param>
        /// <param name="idCardType">证件类型（可为空，证件号不为空时有效）</param>
        /// <returns></returns>
        BankCardCheckResult Check(string accountNo, string accountName, string idCardNo, string idCardType);

        /// <summary>
        /// 校验银行卡信息（四要素校验）
        /// </summary>
        /// <param name="accountNo">银行卡号</param>
        /// <param name="accountName">户名、姓名</param>
        /// <param name="idCardNo">证件号（证件号，证件类型为空时为身份证号）</param>
        /// <param name="idCardType">证件类型（可为空，证件号不为空时有效）</param>
        /// <param name="phone">电话号码</param>
        /// <returns></returns>
        BankCardCheckResult Check(string accountNo, string accountName, string idCardNo, string idCardType, string phone);
    }

    /// <summary>
    /// 校验结果
    /// </summary>
    public class BankCardCheckResult
    {
        /// <summary>
        /// 校验结果编码
        /// -1：执行失败
        /// 0：校验成功 
        /// 1：执行成功，校验结果为失败
        /// </summary>
        public int Code { get; set; }

        /// <summary>
        /// 校验结果信息
        /// </summary>
        public string Message { get; set; }
    }

    /// <summary>
    /// 系统内部校验结果
    /// </summary>
    public class BankCardCheckInnerResult
    {
        /// <summary>
        /// 是否继续校验
        /// </summary>
        public bool IsContinueCheck { get; set; }

        /// <summary>
        /// 校验结果
        /// </summary>
        public BankCardCheckResult CheckResult { get; set; }
    }
}
